<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/system/workbusiness/V_PLAN_WORK_ORDER.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/system/workbusiness/V_PLAN_WORK_ORDER.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'Order_Id',
                footer: "Foots",
                cnName: '工单激活Main',
                name: 'workbusiness/V_PLAN_WORK_ORDER',
                url: "/V_PLAN_WORK_ORDER/",
                sortName: "CreateOn"
            });
            const editFormFields = ref({"CreateBy":""});
            const editFormOptions = ref([[{"title":"","field":"CreateBy","type":"text"}]]);
            const searchFormFields = ref({"OrderCode":"","WorkCenterId":"","ProcessRouteId":"","OrderType":""});
            const searchFormOptions = ref([[{"dataKey":"工单（没有Id）","data":[],"title":"工单","field":"OrderCode","type":"select"},{"dataKey":"工作中心","data":[],"title":"工作中心","field":"WorkCenterId","type":"select"},{"dataKey":"工艺路线","data":[],"title":"工艺路线","field":"ProcessRouteId","type":"select"},{"dataKey":"工单类型","data":[],"title":"工单类型","field":"OrderType","type":"select"}]]);
            const columns = ref([{field:'Order_Id',title:'Order_Id',type:'string',width:110,hidden:true,require:true,align:'left'},
                       {field:'OrderCode',title:'工单',type:'string',bind:{ key:'工单（没有Id）',data:[]},width:110,align:'left',sort:true},
                       {field:'ProductId',title:'模具&产品',type:'string',bind:{ key:'物料',data:[]},width:110,align:'left'},
                       {field:'WorkCenterId',title:'工作中心',type:'string',bind:{ key:'工作中心',data:[]},width:110,align:'left'},
                       {field:'ProductBOMId',title:'模具&产品BOM',type:'string',bind:{ key:'产品BOM',data:[]},width:110,align:'left'},
                       {field:'ProcessRouteId',title:'工艺路线',type:'string',bind:{ key:'工艺路线',data:[]},width:110,align:'left'},
                       {field:'OrderType',title:'工单类型',type:'string',bind:{ key:'工单类型',data:[]},width:110,align:'left'},
                       {field:'OrderQuantity',title:'单件加工数量',type:'decimal',width:110,align:'left'},
                       {field:'PlanStart',title:'计划开始时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'PlanEnd',title:'计划结束时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'Description',title:'Description',type:'string',width:220,hidden:true,align:'left'},
                       {field:'work_order_number',title:'work_order_number',type:'string',width:220,hidden:true,align:'left'},
                       {field:'workpiece_id',title:'workpiece_id',type:'int',width:110,hidden:true,align:'left'},
                       {field:'priority',title:'priority',type:'int',width:110,hidden:true,align:'left'},
                       {field:'material_id',title:'material_id',type:'int',width:110,hidden:true,align:'left'},
                       {field:'processing_grade',title:'processing_grade',type:'int',width:110,hidden:true,align:'left'},
                       {field:'length',title:'length',type:'decimal',width:110,hidden:true,align:'left'},
                       {field:'width',title:'width',type:'decimal',width:110,hidden:true,align:'left'},
                       {field:'height',title:'height',type:'decimal',width:110,hidden:true,align:'left'},
                       {field:'measure_number',title:'measure_number',type:'string',width:220,hidden:true,align:'left'},
                       {field:'centring_number',title:'centring_number',type:'string',width:220,hidden:true,align:'left'},
                       {field:'make_level_number',title:'make_level_number',type:'string',width:220,hidden:true,align:'left'},
                       {field:'accuracy',title:'accuracy',type:'decimal',width:110,hidden:true,align:'left'},
                       {field:'process_Status',title:'process_Status',type:'int',width:110,hidden:true,align:'left'},
                       {field:'Status',title:'Status',type:'string',width:110,hidden:true,align:'left'},
                       {field:'IsActivation',title:'IsActivation',type:'string',width:110,hidden:true,align:'left'},
                       {field:'CreateBy',title:'CreateBy',type:'string',width:110,hidden:true,align:'left'},
                       {field:'CreateOn',title:'CreateOn',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'UpdateBy',title:'UpdateBy',type:'string',width:110,hidden:true,align:'left'},
                       {field:'LastUpdateOn',title:'LastUpdateOn',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'IsDeleted',title:'IsDeleted',type:'bool',width:110,hidden:true,align:'left'}]);
            const detail = ref({
                cnName: "工单激活",
                table: "PLAN_WORK_ORDER_EQU",
                columns: [{field:'Id',title:'Id',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'Order_Id',title:'工单',type:'string',bind:{ key:'工单',data:[]},width:110,edit:{type:'select'},align:'left',sort:true},
                       {field:'EquipmentCompleteQty',title:'设备数量',type:'int',width:110,edit:{type:'number'},align:'left'},
                       {field:'OperationId',title:'工序',type:'string',bind:{ key:'工序',data:[]},width:110,edit:{type:'select'},align:'left'},
                       {field:'Equipment_Id',title:'设备',type:'string',bind:{ key:'设备',data:[]},width:120,edit:{type:'select'},align:'left'},
                       {field:'CurrentPlanProcessTime',title:'当前计划加工时间',type:'decimal',width:110,align:'left'},
                       {field:'CurrentRemainProcessTime',title:'当前剩余加工时间',type:'decimal',width:110,align:'left'},
                       {field:'CurrentCompletTime',title:'当前完成时间',type:'decimal',width:110,align:'left'},
                       {field:'Description',title:'描述',type:'string',width:220,align:'left'},
                       {field:'Status',title:'新建/激活/保留/废除',type:'string',width:110,hidden:true,align:'left'},
                       {field:'CreateBy',title:'创建人',type:'string',width:110,hidden:true,align:'left'},
                       {field:'CreateOn',title:'创建时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'UpdateBy',title:'更新人',type:'string',width:110,hidden:true,align:'left'},
                       {field:'LastUpdateOn',title:'更新时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'IsDeleted',title:'逻辑删除 0/不删除 1/已删除',type:'bool',width:110,hidden:true,align:'left'}],
                sortName: "CreateOn",
                key: "Id"
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
